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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.txt = txt

g = A("g")
d = B("d")
f = C("f")
i = D("i")
a = E("a")
h = B("h")
e = D("e")
n = D("n")

g.o = e
g.s = e
g.p = e
g.q = d
g.t = h
d.v = a
d.t = f
d.y = f
f.r = h
f.t = h
i.v = e
a.z = i
a.u = f
h.v = a
h.t = f
h.y = f
e.v = n
n.v = i
assert n.v.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: D = None
        self.p: D = None
        self.q: B = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: C = None
        self.txt = txt

g = A("g")
d = B("d")
f = C("f")
i = D("i")
a = E("a")
h = B("h")
e = D("e")
n = D("n")

g.o = e
g.s = e
g.p = e
g.q = d
g.t = h
d.v = a
d.t = f
d.y = f
f.r = h
f.t = h
i.v = e
a.z = i
a.u = f
h.v = a
h.t = f
h.y = f
e.v = n
n.v = i
assert n.v.v.v.v.v.v.v.txt == "i"