class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: F = None
        self.w: A = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.o: B = None
        self.v: A = None
        self.w: G = None
        self.s: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: F = None
        self.w: A = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.o: B = None
        self.v: A = None
        self.w: G = None
        self.s: B = None
        self.txt = txt

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

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

a.w = c
n.p = c
n.y = i
n.w = a
n.s = a
n.v = a
d.x = m
d.y = c
d.u = a
m.p = l
l.p = a
l.o = e
i.x = n
i.z = n
i.o = n
i.s = n
i.v = a
i.w = c
c.r = d
c.q = d
c.y = d
c.o = m
c.z = i
c.u = i
c.v = b
e.x = m
e.y = c
e.u = a
b.p = a
b.o = d
assert i.s.y.s.v.w.txt == "c"