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

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

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

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

j = A("j")
d = B("d")
l = C("l")
k = D("k")
c = D("c")
m = B("m")
b = D("b")
n = A("n")

j.y = l
j.x = l
j.w = n
d.p = m
d.q = m
d.o = b
l.v = n
l.r = n
l.x = n
l.q = m
k.u = c
c.u = b
m.p = d
m.q = d
m.o = c
b.u = c
n.y = l
n.x = l
n.w = j
assert l.q.o.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

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

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

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

j = A("j")
d = B("d")
l = C("l")
k = D("k")
c = D("c")
m = B("m")
b = D("b")
n = A("n")

j.y = l
j.x = l
j.w = n
d.p = m
d.q = m
d.o = b
l.v = n
l.r = n
l.x = n
l.q = m
k.u = c
c.u = b
m.p = d
m.q = d
m.o = c
b.u = c
n.y = l
n.x = l
n.w = j
assert l.q.o.u.u.u.txt == "b"