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

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

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

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

d = A("d")
j = B("j")
l = C("l")
k = D("k")
n = B("n")
c = C("c")

d.s = k
d.o = j
d.v = c
j.x = n
j.t = l
j.w = d
l.q = c
l.t = k
l.u = k
l.v = n
k.y = c
k.p = c
k.v = d
k.w = d
n.x = j
n.t = c
n.w = d
c.q = l
c.t = k
c.u = k
c.v = j
assert d.o.t.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: B = None
        self.v: C = None
        self.txt = txt

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

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

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

d = A("d")
j = B("j")
l = C("l")
k = D("k")
n = B("n")
c = C("c")

d.s = k
d.o = j
d.v = c
j.x = n
j.t = l
j.w = d
l.q = c
l.t = k
l.u = k
l.v = n
k.y = c
k.p = c
k.v = d
k.w = d
n.x = j
n.t = c
n.w = d
c.q = l
c.t = k
c.u = k
c.v = j
assert d.o.t.q.q.txt == "l"