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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: E = None
        self.x: C = None
        self.z: G = None
        self.q: F = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: G = None
        self.v: G = None
        self.p: G = None
        self.t: D = None
        self.txt = txt

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

h.t = a
h.v = i
i.p = c
i.z = c
i.v = j
i.x = l
i.q = b
i.s = n
l.u = h
l.x = i
l.s = n
n.s = b
n.v = h
n.z = h
j.z = k
b.o = j
b.s = j
b.v = n
b.q = l
c.y = l
c.q = k
c.v = k
c.p = k
c.t = n
a.t = h
a.v = i
k.y = l
k.q = c
k.v = c
k.p = c
k.t = n
assert h.t.v.v.z.v.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: E = None
        self.x: C = None
        self.z: G = None
        self.q: F = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: G = None
        self.v: G = None
        self.p: G = None
        self.t: D = None
        self.txt = txt

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

h.t = a
h.v = i
i.p = c
i.z = c
i.v = j
i.x = l
i.q = b
i.s = n
l.u = h
l.x = i
l.s = n
n.s = b
n.v = h
n.z = h
j.z = k
b.o = j
b.s = j
b.v = n
b.q = l
c.y = l
c.q = k
c.v = k
c.p = k
c.t = n
a.t = h
a.v = i
k.y = l
k.q = c
k.v = c
k.p = c
k.t = n
assert h.t.v.v.z.v.y.x.txt == "i"