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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.s: B = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

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

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

e = A("e")
b = B("b")
d = C("d")
n = D("n")
i = E("i")
a = F("a")
l = C("l")
c = D("c")

e.r = n
e.o = a
e.w = a
e.t = i
b.z = i
b.q = i
b.w = a
b.o = e
d.z = a
d.x = b
n.u = b
n.t = b
n.s = b
n.w = a
n.o = i
i.u = c
i.w = a
i.v = e
i.x = d
a.z = i
a.s = i
l.z = a
l.x = b
c.u = b
c.t = b
c.s = b
c.w = a
c.o = i
assert d.z.z.x.x.z.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: F = None
        self.t: E = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: B = None
        self.s: B = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

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

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

e = A("e")
b = B("b")
d = C("d")
n = D("n")
i = E("i")
a = F("a")
l = C("l")
c = D("c")

e.r = n
e.o = a
e.w = a
e.t = i
b.z = i
b.q = i
b.w = a
b.o = e
d.z = a
d.x = b
n.u = b
n.t = b
n.s = b
n.w = a
n.o = i
i.u = c
i.w = a
i.v = e
i.x = d
a.z = i
a.s = i
l.z = a
l.x = b
c.u = b
c.t = b
c.s = b
c.w = a
c.o = i
assert d.z.z.x.x.z.x.x.txt == "b"