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

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

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

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

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

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

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

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

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

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

k.v = b
k.t = b
k.w = c
k.y = n
m.t = k
m.x = h
m.q = h
m.y = h
c.y = l
c.s = b
l.u = n
l.y = b
n.t = k
n.x = c
n.q = c
n.y = h
h.y = l
h.s = k
j.u = n
j.y = k
b.v = k
b.t = k
b.w = c
b.y = m
assert j.u.x.s.v.v.txt == "b"