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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: G = None
        self.y: A = None
        self.w: D = None
        self.s: G = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: G = None
        self.y: A = None
        self.w: D = None
        self.s: G = None
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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