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

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

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

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

n = A("n")
l = B("l")
m = C("m")
a = D("a")
c = A("c")
b = D("b")
j = C("j")

n.y = a
l.s = j
l.x = j
l.v = c
m.x = n
m.o = j
m.y = j
m.w = c
a.w = b
a.q = b
a.y = l
a.t = l
c.y = b
b.w = a
b.q = a
b.y = l
b.t = l
j.x = c
j.o = m
j.y = m
j.w = n
assert c.y.t.s.w.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

n = A("n")
l = B("l")
m = C("m")
a = D("a")
c = A("c")
b = D("b")
j = C("j")

n.y = a
l.s = j
l.x = j
l.v = c
m.x = n
m.o = j
m.y = j
m.w = c
a.w = b
a.q = b
a.y = l
a.t = l
c.y = b
b.w = a
b.q = a
b.y = l
b.t = l
j.x = c
j.o = m
j.y = m
j.w = n
assert c.y.t.s.w.y.q.txt == "b"