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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.r: C = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

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

e = A("e")
m = B("m")
b = C("b")
h = D("h")
k = E("k")
j = D("j")

e.q = k
e.o = b
m.q = k
m.u = h
b.p = j
b.q = j
h.u = e
h.t = e
h.p = j
h.s = j
h.r = b
k.t = e
k.q = e
k.z = h
k.o = j
j.u = e
j.t = e
j.p = h
j.s = h
j.r = b
assert k.q.o.p.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: D = None
        self.r: C = None
        self.s: D = None
        self.t: A = None
        self.txt = txt

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

e = A("e")
m = B("m")
b = C("b")
h = D("h")
k = E("k")
j = D("j")

e.q = k
e.o = b
m.q = k
m.u = h
b.p = j
b.q = j
h.u = e
h.t = e
h.p = j
h.s = j
h.r = b
k.t = e
k.q = e
k.z = h
k.o = j
j.u = e
j.t = e
j.p = h
j.s = h
j.r = b
assert k.q.o.p.u.o.txt == "b"