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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: A = None
        self.p: C = None
        self.q: G = None
        self.t: C = None
        self.w: A = None
        self.s: A = None
        self.y: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: D = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: A = None
        self.p: C = None
        self.q: G = None
        self.t: C = None
        self.w: A = None
        self.s: A = None
        self.y: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: D = None
        self.s: E = None
        self.txt = txt

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

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