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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: B = None
        self.x: E = None
        self.q: G = None
        self.w: A = None
        self.p: A = None
        self.t: G = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: H = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: D = None
        self.t: B = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: F = None
        self.s: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: B = None
        self.x: E = None
        self.q: G = None
        self.w: A = None
        self.p: A = None
        self.t: G = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: H = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: D = None
        self.t: B = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: F = None
        self.s: E = None
        self.txt = txt

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

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