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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.v: E = None
        self.q: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

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

a = A("a")
i = B("i")
g = C("g")
m = D("m")
l = E("l")
e = F("e")
f = G("f")
k = A("k")
n = F("n")

a.z = i
a.v = l
i.y = f
i.x = f
i.v = l
i.q = n
g.z = l
m.y = g
m.o = g
l.x = e
e.o = l
e.s = g
e.r = i
f.s = e
f.x = g
f.u = m
k.z = i
k.v = l
n.o = l
n.s = g
n.r = i
assert a.v.x.s.z.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.v: E = None
        self.q: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

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

a = A("a")
i = B("i")
g = C("g")
m = D("m")
l = E("l")
e = F("e")
f = G("f")
k = A("k")
n = F("n")

a.z = i
a.v = l
i.y = f
i.x = f
i.v = l
i.q = n
g.z = l
m.y = g
m.o = g
l.x = e
e.o = l
e.s = g
e.r = i
f.s = e
f.x = g
f.u = m
k.z = i
k.v = l
n.o = l
n.s = g
n.r = i
assert a.v.x.s.z.x.s.txt == "g"