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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: G = None
        self.p: D = None
        self.y: G = None
        self.r: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: G = None
        self.p: D = None
        self.y: G = None
        self.r: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: E = None
        self.txt = txt

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

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