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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: F = None
        self.txt = txt

i = A("i")
k = B("k")
f = C("f")
l = D("l")
j = E("j")
n = F("n")
h = G("h")
a = D("a")
d = F("d")

i.t = j
i.v = f
k.z = n
f.q = l
l.w = f
l.t = a
l.o = a
l.q = j
j.t = f
n.t = h
h.s = k
h.p = d
a.w = f
a.t = l
a.o = l
a.q = j
d.t = h
assert d.t.p.t.p.t.p.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: F = None
        self.txt = txt

i = A("i")
k = B("k")
f = C("f")
l = D("l")
j = E("j")
n = F("n")
h = G("h")
a = D("a")
d = F("d")

i.t = j
i.v = f
k.z = n
f.q = l
l.w = f
l.t = a
l.o = a
l.q = j
j.t = f
n.t = h
h.s = k
h.p = d
a.w = f
a.t = l
a.o = l
a.q = j
d.t = h
assert d.t.p.t.p.t.p.t.s.txt == "k"