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

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

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

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

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

j = A("j")
a = B("a")
k = C("k")
d = D("d")
i = E("i")
m = D("m")
f = D("f")

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

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

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

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

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

j = A("j")
a = B("a")
k = C("k")
d = D("d")
i = E("i")
m = D("m")
f = D("f")

j.u = d
a.s = f
k.y = i
d.q = i
d.t = i
d.w = f
d.r = f
d.u = j
i.w = f
i.q = j
i.y = j
i.x = j
i.t = a
m.q = i
m.t = i
m.w = f
m.r = d
m.u = j
f.q = i
f.t = i
f.w = m
f.r = d
f.u = j
assert k.y.t.s.t.t.s.txt == "f"