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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.x: A = None
        self.v: E = None
        self.z: D = None
        self.q: F = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: B = None
        self.w: G = None
        self.t: A = None
        self.v: F = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.x: A = None
        self.v: E = None
        self.z: D = None
        self.q: F = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: B = None
        self.w: G = None
        self.t: A = None
        self.v: F = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.txt = txt

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

i.v = k
k.w = i
k.y = i
k.x = i
k.v = g
k.z = e
k.q = d
k.u = l
n.o = j
n.w = j
n.p = k
n.u = k
n.z = k
n.t = i
n.v = d
f.x = n
f.s = e
g.v = d
d.q = e
h.s = l
h.w = i
j.s = l
j.w = i
e.x = n
e.s = f
l.x = n
l.s = f
assert h.s.s.s.x.t.txt == "i"