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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: F = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: F = None
        self.z: E = None
        self.q: H = None
        self.y: C = None
        self.t: F = None
        self.txt = txt

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

n = A("n")
f = B("f")
g = C("g")
e = D("e")
d = E("d")
m = F("m")
h = G("h")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: F = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: F = None
        self.z: E = None
        self.q: H = None
        self.y: C = None
        self.t: F = None
        self.txt = txt

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

n = A("n")
f = B("f")
g = C("g")
e = D("e")
d = E("d")
m = F("m")
h = G("h")
k = H("k")

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