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

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

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

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

j = A("j")
l = B("l")
e = C("e")
f = D("f")
k = C("k")
c = A("c")

j.s = l
j.v = c
l.z = f
l.t = f
e.x = k
e.o = c
e.w = l
e.y = l
f.r = e
k.x = e
k.o = c
k.w = l
k.y = l
c.s = l
c.v = j
assert l.z.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: A = None
        self.txt = txt

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

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

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

j = A("j")
l = B("l")
e = C("e")
f = D("f")
k = C("k")
c = A("c")

j.s = l
j.v = c
l.z = f
l.t = f
e.x = k
e.o = c
e.w = l
e.y = l
f.r = e
k.x = e
k.o = c
k.w = l
k.y = l
c.s = l
c.v = j
assert l.z.r.x.txt == "k"