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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.y: E = None
        self.txt = txt

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

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