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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.z: C = None
        self.x: A = None
        self.y: A = None
        self.r: A = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.x: F = None
        self.p: E = None
        self.w: C = None
        self.s: F = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.q: B = None
        self.u: E = None
        self.txt = txt

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

c.u = m
i.w = m
i.s = m
i.z = m
i.x = c
i.y = c
i.r = c
i.u = a
m.q = c
m.x = j
j.y = n
j.p = n
j.o = n
j.z = i
j.x = a
j.s = a
j.w = m
n.y = c
n.z = c
n.r = a
a.z = n
a.r = j
k.o = j
k.w = i
k.q = i
k.u = n
assert n.r.z.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: C = None
        self.z: C = None
        self.x: A = None
        self.y: A = None
        self.r: A = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.x: F = None
        self.p: E = None
        self.w: C = None
        self.s: F = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: A = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.q: B = None
        self.u: E = None
        self.txt = txt

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

c.u = m
i.w = m
i.s = m
i.z = m
i.x = c
i.y = c
i.r = c
i.u = a
m.q = c
m.x = j
j.y = n
j.p = n
j.o = n
j.z = i
j.x = a
j.s = a
j.w = m
n.y = c
n.z = c
n.r = a
a.z = n
a.r = j
k.o = j
k.w = i
k.q = i
k.u = n
assert n.r.z.r.txt == "a"