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

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

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

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

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

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

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

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

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

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

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