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

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

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

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

c = A("c")
d = B("d")
a = C("a")
f = D("f")
b = A("b")
j = B("j")
h = C("h")
l = C("l")

c.x = b
c.u = b
d.y = c
d.o = f
a.z = j
a.x = j
a.v = d
f.u = d
f.w = d
f.x = c
f.y = j
b.x = c
b.u = c
j.y = c
j.o = f
h.z = d
h.v = d
h.x = j
l.z = d
l.x = d
l.v = j
assert l.v.y.u.u.x.x.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: A = None
        self.txt = txt

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

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

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

c = A("c")
d = B("d")
a = C("a")
f = D("f")
b = A("b")
j = B("j")
h = C("h")
l = C("l")

c.x = b
c.u = b
d.y = c
d.o = f
a.z = j
a.x = j
a.v = d
f.u = d
f.w = d
f.x = c
f.y = j
b.x = c
b.u = c
j.y = c
j.o = f
h.z = d
h.v = d
h.x = j
l.z = d
l.x = d
l.v = j
assert l.v.y.u.u.x.x.u.x.txt == "c"