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

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: D = None
        self.s: E = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

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

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

g = A("g")
d = B("d")
f = C("f")
i = D("i")
e = E("e")
b = C("b")
l = A("l")
c = C("c")
j = B("j")
m = E("m")

g.o = l
g.r = c
g.x = i
g.y = e
d.o = j
d.q = i
d.u = i
d.y = i
d.s = e
f.u = c
i.z = l
i.w = m
i.y = j
i.o = j
e.s = j
e.u = j
e.p = j
e.y = m
e.z = i
b.u = f
l.o = g
l.r = f
l.x = i
l.y = e
c.u = b
j.o = d
j.q = i
j.u = i
j.y = i
j.s = m
m.s = j
m.u = d
m.p = d
m.y = e
m.z = i
assert c.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: C = None
        self.x: D = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: B = None
        self.q: D = None
        self.s: E = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

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

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

g = A("g")
d = B("d")
f = C("f")
i = D("i")
e = E("e")
b = C("b")
l = A("l")
c = C("c")
j = B("j")
m = E("m")

g.o = l
g.r = c
g.x = i
g.y = e
d.o = j
d.q = i
d.u = i
d.y = i
d.s = e
f.u = c
i.z = l
i.w = m
i.y = j
i.o = j
e.s = j
e.u = j
e.p = j
e.y = m
e.z = i
b.u = f
l.o = g
l.r = f
l.x = i
l.y = e
c.u = b
j.o = d
j.q = i
j.u = i
j.y = i
j.s = m
m.s = j
m.u = d
m.p = d
m.y = e
m.z = i
assert c.u.u.u.txt == "c"