class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: C = None
        self.o: B = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: B = None
        self.p: C = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: G = None
        self.x: G = None
        self.u: G = None
        self.v: F = None
        self.txt = txt

i = A("i")
h = B("h")
e = C("e")
k = D("k")
f = E("f")
b = F("b")
n = G("n")
j = H("j")
d = C("d")
m = A("m")

i.u = h
i.q = f
h.x = n
e.y = b
e.q = d
e.o = h
e.x = f
k.x = d
f.v = h
f.r = h
f.u = e
f.w = e
f.t = e
f.z = n
f.y = i
b.w = k
b.y = m
b.r = f
n.z = h
n.v = h
n.p = e
n.w = j
n.o = k
j.w = b
j.v = b
j.p = n
j.x = n
j.u = n
d.y = b
d.q = e
d.o = h
d.x = f
m.u = h
m.q = f
assert m.q.r.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: C = None
        self.o: B = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: B = None
        self.p: C = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: G = None
        self.x: G = None
        self.u: G = None
        self.v: F = None
        self.txt = txt

i = A("i")
h = B("h")
e = C("e")
k = D("k")
f = E("f")
b = F("b")
n = G("n")
j = H("j")
d = C("d")
m = A("m")

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