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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: D = None
        self.o: A = None
        self.u: F = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: D = None
        self.q: C = None
        self.r: A = None
        self.t: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: D = None
        self.o: A = None
        self.u: F = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: D = None
        self.q: C = None
        self.r: A = None
        self.t: C = None
        self.z: F = None
        self.txt = txt

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

m.u = g
m.v = b
a.t = i
a.z = i
a.y = m
i.v = k
i.z = m
i.r = g
k.q = e
k.y = m
g.o = k
g.x = b
e.q = m
e.o = m
e.t = k
e.u = b
e.x = g
f.y = g
f.p = k
f.q = i
f.t = i
f.r = m
f.z = b
b.q = m
b.o = m
b.t = k
b.u = e
b.x = g
assert i.z.v.t.q.o.u.x.o.txt == "m"