class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.p: B = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: B = None
        self.p: B = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: A = None
        self.txt = txt

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

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

i.z = l
i.u = d
i.o = d
g.v = m
d.x = m
d.u = i
d.z = g
a.t = n
a.q = g
a.p = l
a.x = d
n.s = m
m.v = b
m.y = i
b.o = k
l.v = m
k.o = b
assert i.z.v.v.o.txt == "k"