class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: D = None
        self.z: D = None
        self.s: D = None
        self.p: G = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: F = None
        self.s: B = None
        self.w: E = None
        self.t: F = None
        self.p: F = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: G = None
        self.x: E = None
        self.t: G = None
        self.p: D = None
        self.w: A = None
        self.txt = txt

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

n = A("n")
a = B("a")
d = C("d")
m = D("m")
h = E("h")
i = F("i")
f = G("f")

n.u = m
n.t = m
n.z = m
n.s = m
n.p = f
n.x = f
n.v = h
a.v = f
a.r = i
a.u = h
a.t = h
d.u = a
d.s = a
d.v = i
d.t = i
d.p = i
d.w = h
d.x = h
m.u = i
m.x = i
m.s = n
h.y = f
h.v = n
h.u = d
i.r = a
i.q = f
i.t = f
i.x = h
i.p = m
i.w = n
f.w = n
f.x = n
f.z = i
assert m.x.p.u.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: D = None
        self.z: D = None
        self.s: D = None
        self.p: G = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: F = None
        self.s: B = None
        self.w: E = None
        self.t: F = None
        self.p: F = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: G = None
        self.x: E = None
        self.t: G = None
        self.p: D = None
        self.w: A = None
        self.txt = txt

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

n = A("n")
a = B("a")
d = C("d")
m = D("m")
h = E("h")
i = F("i")
f = G("f")

n.u = m
n.t = m
n.z = m
n.s = m
n.p = f
n.x = f
n.v = h
a.v = f
a.r = i
a.u = h
a.t = h
d.u = a
d.s = a
d.v = i
d.t = i
d.p = i
d.w = h
d.x = h
m.u = i
m.x = i
m.s = n
h.y = f
h.v = n
h.u = d
i.r = a
i.q = f
i.t = f
i.x = h
i.p = m
i.w = n
f.w = n
f.x = n
f.z = i
assert m.x.p.u.r.v.txt == "f"