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

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

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

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

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

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

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

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

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

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

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

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

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