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

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

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

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

g = A("g")
f = B("f")
k = C("k")
n = D("n")
i = A("i")
l = C("l")
h = A("h")
c = C("c")
j = A("j")
a = B("a")

g.o = i
g.v = h
f.s = g
f.u = j
k.t = c
n.u = j
n.t = l
n.o = a
n.w = c
i.o = g
i.v = j
l.t = c
h.o = j
h.v = j
c.t = k
j.o = i
j.v = h
a.s = g
a.u = i
assert j.v.v.o.v.v.v.o.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

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

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

g = A("g")
f = B("f")
k = C("k")
n = D("n")
i = A("i")
l = C("l")
h = A("h")
c = C("c")
j = A("j")
a = B("a")

g.o = i
g.v = h
f.s = g
f.u = j
k.t = c
n.u = j
n.t = l
n.o = a
n.w = c
i.o = g
i.v = j
l.t = c
h.o = j
h.v = j
c.t = k
j.o = i
j.v = h
a.s = g
a.u = i
assert j.v.v.o.v.v.v.o.v.o.txt == "i"