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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

d.y = i
d.t = h
d.p = c
d.r = e
h.u = m
i.x = m
i.w = m
i.t = j
i.u = e
i.q = h
a.p = h
a.s = c
e.y = c
e.p = b
c.y = i
c.t = h
c.p = d
c.r = b
b.y = c
b.p = e
m.x = i
m.w = i
m.t = j
m.u = b
m.q = h
j.u = i
assert b.y.y.u.p.txt == "b"