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

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

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

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

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

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

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

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

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

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

n.s = c
n.r = i
n.x = i
n.v = g
g.v = d
k.s = l
k.p = d
k.v = d
k.o = d
d.w = k
d.y = g
d.u = i
d.t = n
i.w = k
i.y = g
i.u = d
i.t = n
l.s = k
l.p = i
l.o = i
l.v = d
c.s = n
c.r = d
c.x = d
c.v = g
assert c.r.u.y.txt == "g"