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

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

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

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

i = A("i")
k = B("k")
j = C("j")
b = D("b")
c = C("c")
e = C("e")
d = A("d")
f = C("f")
n = D("n")
h = C("h")

i.v = k
i.q = k
i.w = k
k.w = i
j.o = c
j.t = h
j.s = i
j.w = n
b.s = c
c.o = h
c.t = h
c.s = i
c.w = n
e.o = c
e.t = j
e.s = d
e.w = n
d.v = k
d.q = k
d.w = k
f.o = h
f.t = j
f.s = d
f.w = b
n.s = c
h.o = c
h.t = f
h.s = d
h.w = b
assert b.s.w.s.t.t.t.t.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.w: B = None
        self.txt = txt

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

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

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

i = A("i")
k = B("k")
j = C("j")
b = D("b")
c = C("c")
e = C("e")
d = A("d")
f = C("f")
n = D("n")
h = C("h")

i.v = k
i.q = k
i.w = k
k.w = i
j.o = c
j.t = h
j.s = i
j.w = n
b.s = c
c.o = h
c.t = h
c.s = i
c.w = n
e.o = c
e.t = j
e.s = d
e.w = n
d.v = k
d.q = k
d.w = k
f.o = h
f.t = j
f.s = d
f.w = b
n.s = c
h.o = c
h.t = f
h.s = d
h.w = b
assert b.s.w.s.t.t.t.t.t.w.txt == "b"