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

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

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

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

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

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

d.t = k
d.q = k
h.t = k
h.s = k
j.u = k
j.v = k
j.w = k
j.t = m
m.p = d
m.o = e
m.u = j
m.t = j
m.z = k
k.x = j
a.t = k
a.q = k
e.p = d
e.o = m
e.u = j
e.t = j
e.z = k
assert j.t.p.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

d.t = k
d.q = k
h.t = k
h.s = k
j.u = k
j.v = k
j.w = k
j.t = m
m.p = d
m.o = e
m.u = j
m.t = j
m.z = k
k.x = j
a.t = k
a.q = k
e.p = d
e.o = m
e.u = j
e.t = j
e.z = k
assert j.t.p.t.x.txt == "j"