class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.y: E = None
        self.r: C = None
        self.z: B = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: G = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.v: F = None
        self.z: E = None
        self.txt = txt

l = A("l")
n = B("n")
i = C("i")
m = D("m")
d = E("d")
h = F("h")
j = G("j")
b = D("b")
g = F("g")

l.u = g
l.v = h
l.r = j
n.o = l
n.q = j
n.r = g
i.o = j
i.p = j
i.w = j
m.w = b
m.v = d
m.y = d
m.r = i
m.z = n
m.p = l
m.x = j
d.y = j
d.p = j
d.o = n
h.t = i
h.z = n
h.r = l
j.w = l
j.x = m
j.v = g
j.z = d
b.w = m
b.v = d
b.y = d
b.r = i
b.z = n
b.p = l
b.x = j
g.t = i
g.z = n
g.r = l
assert n.q.v.z.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: E = None
        self.y: E = None
        self.r: C = None
        self.z: B = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: G = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.v: F = None
        self.z: E = None
        self.txt = txt

l = A("l")
n = B("n")
i = C("i")
m = D("m")
d = E("d")
h = F("h")
j = G("j")
b = D("b")
g = F("g")

l.u = g
l.v = h
l.r = j
n.o = l
n.q = j
n.r = g
i.o = j
i.p = j
i.w = j
m.w = b
m.v = d
m.y = d
m.r = i
m.z = n
m.p = l
m.x = j
d.y = j
d.p = j
d.o = n
h.t = i
h.z = n
h.r = l
j.w = l
j.x = m
j.v = g
j.z = d
b.w = m
b.v = d
b.y = d
b.r = i
b.z = n
b.p = l
b.x = j
g.t = i
g.z = n
g.r = l
assert n.q.v.z.o.v.txt == "h"