class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: F = None
        self.x: B = None
        self.r: F = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

i.o = m
i.y = e
i.r = e
i.z = e
i.x = k
k.r = m
k.t = i
c.v = a
c.t = i
c.y = e
m.w = l
l.v = e
l.o = a
l.z = k
e.r = m
b.v = m
b.w = m
b.u = k
b.s = i
a.v = c
a.t = i
a.y = e
assert m.w.o.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: F = None
        self.x: B = None
        self.r: F = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

i.o = m
i.y = e
i.r = e
i.z = e
i.x = k
k.r = m
k.t = i
c.v = a
c.t = i
c.y = e
m.w = l
l.v = e
l.o = a
l.z = k
e.r = m
b.v = m
b.w = m
b.u = k
b.s = i
a.v = c
a.t = i
a.y = e
assert m.w.o.v.y.txt == "e"