class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: C = None
        self.w: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.y: F = None
        self.z: E = None
        self.r: A = None
        self.u: F = None
        self.v: E = None
        self.txt = txt

n = A("n")
c = B("c")
b = C("b")
h = D("h")
k = E("k")
j = F("j")
m = G("m")

n.y = m
n.r = b
n.w = h
n.u = k
c.z = h
c.q = n
c.r = n
b.p = c
b.r = c
b.z = c
b.u = h
b.v = n
b.t = n
h.o = m
h.p = m
h.y = m
h.u = k
h.z = b
h.q = n
h.v = j
k.v = m
k.z = m
k.q = c
j.t = k
j.q = b
m.s = n
m.x = n
m.r = n
m.y = j
m.u = j
m.z = k
m.v = k
assert c.r.r.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: C = None
        self.w: D = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.y: F = None
        self.z: E = None
        self.r: A = None
        self.u: F = None
        self.v: E = None
        self.txt = txt

n = A("n")
c = B("c")
b = C("b")
h = D("h")
k = E("k")
j = F("j")
m = G("m")

n.y = m
n.r = b
n.w = h
n.u = k
c.z = h
c.q = n
c.r = n
b.p = c
b.r = c
b.z = c
b.u = h
b.v = n
b.t = n
h.o = m
h.p = m
h.y = m
h.u = k
h.z = b
h.q = n
h.v = j
k.v = m
k.z = m
k.q = c
j.t = k
j.q = b
m.s = n
m.x = n
m.r = n
m.y = j
m.u = j
m.z = k
m.v = k
assert c.r.r.p.q.txt == "n"