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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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