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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.z: C = None
        self.w: E = None
        self.x: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

b.r = a
b.o = k
b.p = k
b.w = e
k.z = d
d.o = c
d.x = c
d.s = k
d.z = i
d.w = a
d.r = a
c.o = b
c.q = k
c.x = d
c.t = d
c.p = a
a.u = d
a.o = k
a.z = k
a.x = k
h.z = k
h.s = d
e.r = a
e.o = k
e.p = k
e.w = b
i.o = c
i.x = c
i.s = k
i.z = d
i.w = a
i.r = a
assert i.z.s.z.o.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: B = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.z: C = None
        self.w: E = None
        self.x: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

b.r = a
b.o = k
b.p = k
b.w = e
k.z = d
d.o = c
d.x = c
d.s = k
d.z = i
d.w = a
d.r = a
c.o = b
c.q = k
c.x = d
c.t = d
c.p = a
a.u = d
a.o = k
a.z = k
a.x = k
h.z = k
h.s = d
e.r = a
e.o = k
e.p = k
e.w = b
i.o = c
i.x = c
i.s = k
i.z = d
i.w = a
i.r = a
assert i.z.s.z.o.q.z.txt == "d"