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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

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

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

a = A("a")
f = B("f")
e = C("e")
l = D("l")
g = E("g")
h = F("h")
d = F("d")
k = D("k")
c = D("c")
n = E("n")

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

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

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

a = A("a")
f = B("f")
e = C("e")
l = D("l")
g = E("g")
h = F("h")
d = F("d")
k = D("k")
c = D("c")
n = E("n")

a.z = g
a.o = h
a.q = f
a.t = c
a.u = e
f.w = e
f.r = e
e.z = c
e.x = n
e.y = a
l.p = a
l.r = a
l.w = e
g.x = h
g.p = k
h.y = g
h.s = g
h.x = g
h.r = e
h.z = a
d.y = g
d.x = g
d.r = e
d.z = a
d.s = n
k.p = a
k.r = a
k.w = e
c.p = a
c.r = a
c.w = e
n.x = d
n.p = c
assert f.r.z.p.u.txt == "e"