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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.u: C = None
        self.s: E = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: A = None
        self.v: E = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: D = None
        self.s: D = None
        self.txt = txt

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

l.o = a
l.z = a
l.q = d
l.u = h
f.w = h
f.y = l
f.r = l
f.u = a
f.s = c
a.z = l
a.u = l
a.v = m
a.s = c
a.t = h
h.y = l
h.z = l
h.w = l
c.v = j
c.r = h
c.s = h
b.w = h
b.y = l
b.r = l
b.u = a
b.s = c
d.y = l
d.z = l
d.w = l
k.w = d
k.y = l
k.r = l
k.u = a
k.s = c
j.w = h
j.y = l
j.r = l
j.u = a
j.s = m
m.v = f
m.r = h
m.s = d
assert a.z.q.z.q.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.u: D = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.u: C = None
        self.s: E = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: A = None
        self.v: E = None
        self.s: E = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: D = None
        self.s: D = None
        self.txt = txt

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

l.o = a
l.z = a
l.q = d
l.u = h
f.w = h
f.y = l
f.r = l
f.u = a
f.s = c
a.z = l
a.u = l
a.v = m
a.s = c
a.t = h
h.y = l
h.z = l
h.w = l
c.v = j
c.r = h
c.s = h
b.w = h
b.y = l
b.r = l
b.u = a
b.s = c
d.y = l
d.z = l
d.w = l
k.w = d
k.y = l
k.r = l
k.u = a
k.s = c
j.w = h
j.y = l
j.r = l
j.u = a
j.s = m
m.v = f
m.r = h
m.s = d
assert a.z.q.z.q.y.q.txt == "d"