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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: G = None
        self.v: G = None
        self.u: G = None
        self.r: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: G = None
        self.v: G = None
        self.u: G = None
        self.r: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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