class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: B = None
        self.p: F = None
        self.x: G = None
        self.u: D = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: C = None
        self.y: D = None
        self.o: F = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: C = None
        self.y: D = None
        self.o: F = None
        self.p: A = None
        self.w: B = None
        self.txt = txt

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

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