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

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

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

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

m = A("m")
d = B("d")
f = C("f")
j = D("j")
a = D("a")
l = B("l")
b = A("b")
g = C("g")

m.v = j
m.w = j
m.y = j
m.u = b
d.y = b
f.y = l
f.s = g
j.o = a
j.y = l
a.o = j
a.y = l
l.y = m
b.v = a
b.u = m
b.w = j
b.y = j
g.y = d
g.s = f
assert d.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: A = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

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

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

m = A("m")
d = B("d")
f = C("f")
j = D("j")
a = D("a")
l = B("l")
b = A("b")
g = C("g")

m.v = j
m.w = j
m.y = j
m.u = b
d.y = b
f.y = l
f.s = g
j.o = a
j.y = l
a.o = j
a.y = l
l.y = m
b.v = a
b.u = m
b.w = j
b.y = j
g.y = d
g.s = f
assert d.y.y.y.txt == "l"