class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.x: C = None
        self.r: B = None
        self.s: C = None
        self.v: C = None
        self.z: B = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: G = None
        self.x: A = None
        self.y: F = None
        self.v: H = None
        self.s: H = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.y: H = None
        self.w: B = None
        self.z: H = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.q: C = None
        self.p: H = None
        self.o: D = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.w: C = None
        self.x: H = None
        self.u: B = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: G = None
        self.x: A = None
        self.y: F = None
        self.v: H = None
        self.s: H = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: A = None
        self.y: H = None
        self.w: B = None
        self.z: H = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.q: C = None
        self.p: H = None
        self.o: D = None
        self.w: A = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.w: C = None
        self.x: H = None
        self.u: B = None
        self.o: B = None
        self.txt = txt

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

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