class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: D = None
        self.x: E = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

i.v = a
i.y = a
i.x = c
i.s = e
l.q = c
f.p = i
f.u = i
f.y = e
f.s = e
f.v = c
a.y = i
a.r = e
a.s = f
a.w = f
a.o = l
c.z = b
e.x = l
d.z = a
d.o = i
b.z = a
b.o = i
assert c.z.o.s.x.q.z.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: D = None
        self.x: E = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

i.v = a
i.y = a
i.x = c
i.s = e
l.q = c
f.p = i
f.u = i
f.y = e
f.s = e
f.v = c
a.y = i
a.r = e
a.s = f
a.w = f
a.o = l
c.z = b
e.x = l
d.z = a
d.o = i
b.z = a
b.o = i
assert c.z.o.s.x.q.z.o.s.txt == "e"