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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: E = None
        self.y: C = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: D = None
        self.p: A = None
        self.z: B = None
        self.r: A = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: F = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: E = None
        self.y: C = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: D = None
        self.p: A = None
        self.z: B = None
        self.r: A = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: F = None
        self.r: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

g.p = k
g.w = k
g.x = k
h.x = d
h.w = m
h.t = m
h.y = n
n.s = k
n.p = k
n.o = c
n.y = c
n.z = h
n.r = g
c.v = m
c.x = i
c.r = h
c.w = h
m.t = i
m.v = d
m.z = f
b.v = d
b.u = n
b.p = k
b.w = f
d.z = m
f.z = m
i.v = d
i.w = d
i.u = n
i.p = g
k.p = g
k.w = g
k.x = g
assert n.z.x.z.txt == "m"