class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: G = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: A = None
        self.z: A = None
        self.x: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: G = None
        self.w: F = None
        self.v: B = None
        self.q: C = None
        self.y: D = None
        self.t: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: A = None
        self.z: A = None
        self.x: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: E = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: G = None
        self.w: F = None
        self.v: B = None
        self.q: C = None
        self.y: D = None
        self.t: F = None
        self.txt = txt

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

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

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

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