class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: C = None
        self.p: C = None
        self.v: E = None
        self.w: B = None
        self.x: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.y: G = None
        self.q: G = None
        self.x: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: D = None
        self.x: G = None
        self.y: B = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.y: G = None
        self.q: G = None
        self.x: F = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: D = None
        self.x: G = None
        self.y: B = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

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

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

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