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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.x: D = None
        self.t: C = None
        self.v: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.p: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.x: D = None
        self.t: C = None
        self.v: A = None
        self.txt = txt

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

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

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