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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: D = None
        self.t: B = None
        self.v: D = None
        self.u: B = None
        self.txt = txt

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

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

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

c = A("c")
k = B("k")
h = C("h")
e = D("e")
i = E("i")
a = B("a")
f = D("f")
m = B("m")
l = C("l")
b = E("b")

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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: D = None
        self.t: B = None
        self.v: D = None
        self.u: B = None
        self.txt = txt

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

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

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

c = A("c")
k = B("k")
h = C("h")
e = D("e")
i = E("i")
a = B("a")
f = D("f")
m = B("m")
l = C("l")
b = E("b")

c.r = b
c.w = i
k.r = m
k.t = m
k.x = e
k.v = f
k.u = a
h.t = l
e.o = f
i.x = h
i.s = l
i.r = b
i.z = b
i.q = e
a.r = k
a.x = f
a.t = m
a.u = m
a.v = e
f.o = e
m.r = a
m.t = a
m.u = a
m.x = f
m.v = e
l.t = h
b.x = l
b.s = h
b.r = i
b.z = i
b.q = f
assert e.o.o.o.o.txt == "e"