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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: A = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

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

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

g.w = d
g.t = n
g.v = n
n.r = l
n.p = g
n.w = k
k.q = l
k.p = g
k.r = j
k.s = n
l.s = k
l.x = g
l.w = j
d.r = l
d.p = g
d.w = j
j.q = l
j.p = g
j.r = k
j.s = n
assert n.r.w.s.r.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: A = None
        self.r: C = None
        self.s: B = None
        self.txt = txt

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

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

g.w = d
g.t = n
g.v = n
n.r = l
n.p = g
n.w = k
k.q = l
k.p = g
k.r = j
k.s = n
l.s = k
l.x = g
l.w = j
d.r = l
d.p = g
d.w = j
j.q = l
j.p = g
j.r = k
j.s = n
assert n.r.w.s.r.w.s.txt == "n"