class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: C = None
        self.q: B = None
        self.p: C = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: A = None
        self.p: B = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

a = A("a")
d = B("d")
n = C("n")
f = D("f")
e = E("e")
j = F("j")
m = E("m")
i = D("i")
k = B("k")

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: A = None
        self.p: B = None
        self.s: D = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

a = A("a")
d = B("d")
n = C("n")
f = D("f")
e = E("e")
j = F("j")
m = E("m")
i = D("i")
k = B("k")

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