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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.o: E = None
        self.v: B = None
        self.z: H = None
        self.p: B = None
        self.x: H = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: A = None
        self.z: E = None
        self.s: G = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: H = None
        self.t: B = None
        self.z: B = None
        self.p: H = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.o: E = None
        self.v: B = None
        self.z: H = None
        self.p: B = None
        self.x: H = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: A = None
        self.z: E = None
        self.s: G = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: H = None
        self.t: B = None
        self.z: B = None
        self.p: H = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

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