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

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

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

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

e = A("e")
i = B("i")
c = C("c")
g = D("g")
a = D("a")
k = A("k")
d = B("d")
f = C("f")
h = C("h")

e.x = k
e.v = d
e.o = d
i.q = h
i.p = d
i.t = d
c.x = f
g.u = a
g.v = i
g.o = i
g.s = h
a.u = g
a.v = d
a.o = i
a.s = c
k.x = e
k.v = i
k.o = i
d.q = f
d.p = i
d.t = i
f.x = c
h.x = c
assert i.q.x.x.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: B = None
        self.o: B = None
        self.txt = txt

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

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

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

e = A("e")
i = B("i")
c = C("c")
g = D("g")
a = D("a")
k = A("k")
d = B("d")
f = C("f")
h = C("h")

e.x = k
e.v = d
e.o = d
i.q = h
i.p = d
i.t = d
c.x = f
g.u = a
g.v = i
g.o = i
g.s = h
a.u = g
a.v = d
a.o = i
a.s = c
k.x = e
k.v = i
k.o = i
d.q = f
d.p = i
d.t = i
f.x = c
h.x = c
assert i.q.x.x.x.x.x.x.x.txt == "c"