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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.v: C = None
        self.z: D = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: G = None
        self.u: E = None
        self.t: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: A = None
        self.v: C = None
        self.z: D = None
        self.x: G = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: G = None
        self.u: E = None
        self.t: E = None
        self.txt = txt

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

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

c.o = i
c.q = i
c.v = d
c.x = n
l.t = e
l.p = c
n.u = l
n.q = l
n.z = e
d.q = j
d.s = n
e.p = n
e.v = n
e.w = c
e.t = c
e.z = d
e.x = i
j.x = d
j.r = i
j.u = e
j.t = e
i.u = c
i.s = c
i.p = d
i.r = l
assert c.x.z.v.z.txt == "e"