class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.u: A = None
        self.z: C = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
i = C("i")
m = D("m")
f = A("f")
c = C("c")
h = D("h")

j.y = c
j.t = c
j.u = f
j.z = i
n.u = i
n.r = m
i.x = f
i.o = j
m.z = h
f.y = i
f.t = c
f.z = c
f.u = j
c.x = j
c.o = j
h.z = m
assert j.z.o.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.u: A = None
        self.z: C = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
i = C("i")
m = D("m")
f = A("f")
c = C("c")
h = D("h")

j.y = c
j.t = c
j.u = f
j.z = i
n.u = i
n.r = m
i.x = f
i.o = j
m.z = h
f.y = i
f.t = c
f.z = c
f.u = j
c.x = j
c.o = j
h.z = m
assert j.z.o.y.x.txt == "j"