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

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

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

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

c = A("c")
m = B("m")
l = C("l")
g = D("g")
j = A("j")
n = C("n")
i = C("i")
b = D("b")

c.p = m
c.s = m
c.q = i
c.y = l
m.u = b
l.x = g
l.y = c
l.t = m
g.t = b
g.q = c
g.u = m
j.p = m
j.s = m
j.q = l
j.y = l
n.x = b
n.y = j
n.t = m
i.x = b
i.y = j
i.t = m
b.t = g
b.q = c
b.u = m
assert m.u.u.u.t.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: B = None
        self.q: C = None
        self.y: C = None
        self.txt = txt

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

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

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

c = A("c")
m = B("m")
l = C("l")
g = D("g")
j = A("j")
n = C("n")
i = C("i")
b = D("b")

c.p = m
c.s = m
c.q = i
c.y = l
m.u = b
l.x = g
l.y = c
l.t = m
g.t = b
g.q = c
g.u = m
j.p = m
j.s = m
j.q = l
j.y = l
n.x = b
n.y = j
n.t = m
i.x = b
i.y = j
i.t = m
b.t = g
b.q = c
b.u = m
assert m.u.u.u.t.t.u.txt == "m"