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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: G = None
        self.y: A = None
        self.w: B = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: G = None
        self.x: D = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

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

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

a.z = c
a.o = e
a.v = h
l.v = c
e.o = l
e.w = l
e.u = h
e.y = a
e.t = m
e.p = m
c.o = a
c.z = h
f.v = g
m.s = a
m.p = h
m.x = c
m.t = c
m.r = i
h.w = a
h.z = m
h.s = g
i.o = l
i.w = l
i.u = h
i.y = a
i.t = m
i.p = m
g.v = f
assert c.z.s.v.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: G = None
        self.y: A = None
        self.w: B = None
        self.t: F = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: G = None
        self.x: D = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

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

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

a.z = c
a.o = e
a.v = h
l.v = c
e.o = l
e.w = l
e.u = h
e.y = a
e.t = m
e.p = m
c.o = a
c.z = h
f.v = g
m.s = a
m.p = h
m.x = c
m.t = c
m.r = i
h.w = a
h.z = m
h.s = g
i.o = l
i.w = l
i.u = h
i.y = a
i.t = m
i.p = m
g.v = f
assert c.z.s.v.v.v.v.v.v.v.txt == "f"