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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: D = None
        self.t: D = None
        self.u: B = None
        self.y: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.t: E = None
        self.y: F = None
        self.o: B = None
        self.txt = txt

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

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

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

a = A("a")
j = B("j")
g = C("g")
m = D("m")
k = E("k")
f = F("f")
l = B("l")
n = F("n")

a.z = j
a.y = k
j.p = m
j.o = m
j.t = m
j.u = l
j.y = k
j.z = k
g.s = a
g.r = n
g.t = k
g.y = f
g.o = j
m.u = f
k.u = a
k.o = n
k.q = g
f.y = g
f.u = m
f.x = a
f.t = j
f.q = j
l.p = m
l.o = m
l.t = m
l.u = j
l.y = k
l.z = k
n.y = g
n.u = m
n.x = a
n.t = l
n.q = l
assert a.z.u.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: D = None
        self.t: D = None
        self.u: B = None
        self.y: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.t: E = None
        self.y: F = None
        self.o: B = None
        self.txt = txt

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

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

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

a = A("a")
j = B("j")
g = C("g")
m = D("m")
k = E("k")
f = F("f")
l = B("l")
n = F("n")

a.z = j
a.y = k
j.p = m
j.o = m
j.t = m
j.u = l
j.y = k
j.z = k
g.s = a
g.r = n
g.t = k
g.y = f
g.o = j
m.u = f
k.u = a
k.o = n
k.q = g
f.y = g
f.u = m
f.x = a
f.t = j
f.q = j
l.p = m
l.o = m
l.t = m
l.u = j
l.y = k
l.z = k
n.y = g
n.u = m
n.x = a
n.t = l
n.q = l
assert a.z.u.p.u.txt == "f"