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

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

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

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

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

f.s = l
f.p = m
f.w = k
f.x = k
c.r = k
c.q = a
c.v = j
j.v = l
j.o = a
e.q = l
e.u = k
e.o = f
e.x = j
m.s = l
m.p = f
m.w = c
m.x = c
a.v = e
a.o = j
k.r = c
k.q = j
k.v = j
l.q = e
l.u = k
l.o = f
l.x = j
assert l.x.v.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: A = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

f.s = l
f.p = m
f.w = k
f.x = k
c.r = k
c.q = a
c.v = j
j.v = l
j.o = a
e.q = l
e.u = k
e.o = f
e.x = j
m.s = l
m.p = f
m.w = c
m.x = c
a.v = e
a.o = j
k.r = c
k.q = j
k.v = j
l.q = e
l.u = k
l.o = f
l.x = j
assert l.x.v.q.x.txt == "j"