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

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

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

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

j = A("j")
a = B("a")
b = C("b")
k = D("k")
e = C("e")

j.v = k
j.y = a
j.u = e
a.y = j
a.o = k
a.u = k
b.z = a
b.o = e
k.s = a
k.w = a
k.r = a
k.t = b
e.z = a
e.o = b
assert j.y.u.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: B = None
        self.u: C = None
        self.txt = txt

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

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

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

j = A("j")
a = B("a")
b = C("b")
k = D("k")
e = C("e")

j.v = k
j.y = a
j.u = e
a.y = j
a.o = k
a.u = k
b.z = a
b.o = e
k.s = a
k.w = a
k.r = a
k.t = b
e.z = a
e.o = b
assert j.y.u.s.u.txt == "k"