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

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

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

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

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

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

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

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

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

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

e.s = k
e.v = m
e.q = j
e.y = j
b.q = a
b.v = a
b.p = l
b.w = j
a.x = m
a.t = k
a.r = e
k.r = e
k.w = m
k.y = j
k.u = a
j.q = a
j.v = a
j.p = l
j.w = b
m.s = k
m.v = e
m.q = b
m.y = b
l.r = e
l.w = m
l.y = j
l.u = a
assert m.v.y.p.txt == "l"