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

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

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

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

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

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

b.p = a
b.x = h
b.y = j
m.p = e
m.x = h
m.s = a
k.u = g
k.w = b
k.s = d
k.t = f
d.r = m
d.z = k
g.q = k
g.u = d
g.s = d
f.u = a
f.w = b
f.s = d
f.t = k
e.u = a
e.w = b
e.s = d
e.t = f
j.u = g
j.w = b
j.s = d
j.t = e
a.q = j
a.u = d
a.s = d
h.p = e
h.x = m
h.s = g
assert k.t.u.s.r.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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

b.p = a
b.x = h
b.y = j
m.p = e
m.x = h
m.s = a
k.u = g
k.w = b
k.s = d
k.t = f
d.r = m
d.z = k
g.q = k
g.u = d
g.s = d
f.u = a
f.w = b
f.s = d
f.t = k
e.u = a
e.w = b
e.s = d
e.t = f
j.u = g
j.w = b
j.s = d
j.t = e
a.q = j
a.u = d
a.s = d
h.p = e
h.x = m
h.s = g
assert k.t.u.s.r.s.q.txt == "j"