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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: C = None
        self.x: E = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.s: F = None
        self.p: H = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.z: A = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: G = None
        self.y: G = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: C = None
        self.x: E = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.s: F = None
        self.p: H = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.z: A = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: G = None
        self.y: G = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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