class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.z: B = None
        self.t: A = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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