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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: E = None
        self.y: E = None
        self.q: G = None
        self.r: C = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: G = None
        self.r: H = None
        self.o: H = None
        self.t: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: E = None
        self.w: A = None
        self.v: H = None
        self.z: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: E = None
        self.y: E = None
        self.q: G = None
        self.r: C = None
        self.s: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: G = None
        self.r: H = None
        self.o: H = None
        self.t: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: E = None
        self.w: A = None
        self.v: H = None
        self.z: F = None
        self.txt = txt

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

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

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