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

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

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

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

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

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

i.r = j
n.p = e
d.r = i
d.y = l
d.w = e
d.q = j
e.p = n
e.v = n
e.u = j
e.y = j
j.t = l
j.u = h
j.p = e
h.r = a
a.t = d
a.u = i
a.p = e
m.p = e
l.r = i
l.y = d
l.w = e
l.q = j
assert d.w.p.p.y.p.p.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

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

i.r = j
n.p = e
d.r = i
d.y = l
d.w = e
d.q = j
e.p = n
e.v = n
e.u = j
e.y = j
j.t = l
j.u = h
j.p = e
h.r = a
a.t = d
a.u = i
a.p = e
m.p = e
l.r = i
l.y = d
l.w = e
l.q = j
assert d.w.p.p.y.p.p.p.y.txt == "j"