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

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

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

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

a = A("a")
l = B("l")
d = C("d")
n = D("n")
m = B("m")
i = B("i")
b = C("b")
c = A("c")
h = D("h")

a.v = c
a.o = c
a.s = c
l.x = b
l.t = n
l.r = i
d.x = l
d.r = h
d.q = a
d.w = n
n.r = c
n.q = h
n.p = i
m.x = b
m.t = h
m.r = l
i.x = b
i.t = h
i.r = m
b.x = i
b.r = n
b.w = n
b.q = a
c.v = a
c.o = a
c.s = a
h.r = c
h.q = n
h.p = i
assert b.q.s.v.o.v.o.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.s: A = None
        self.txt = txt

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

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

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

a = A("a")
l = B("l")
d = C("d")
n = D("n")
m = B("m")
i = B("i")
b = C("b")
c = A("c")
h = D("h")

a.v = c
a.o = c
a.s = c
l.x = b
l.t = n
l.r = i
d.x = l
d.r = h
d.q = a
d.w = n
n.r = c
n.q = h
n.p = i
m.x = b
m.t = h
m.r = l
i.x = b
i.t = h
i.r = m
b.x = i
b.r = n
b.w = n
b.q = a
c.v = a
c.o = a
c.s = a
h.r = c
h.q = n
h.p = i
assert b.q.s.v.o.v.o.v.v.txt == "c"