class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: C = None
        self.y: F = None
        self.v: G = None
        self.z: C = None
        self.r: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: D = None
        self.r: G = None
        self.x: B = None
        self.o: G = None
        self.p: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: D = None
        self.r: G = None
        self.x: B = None
        self.o: G = None
        self.p: F = None
        self.z: G = None
        self.txt = txt

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

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

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

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