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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.w: G = None
        self.r: A = None
        self.u: B = None
        self.s: G = None
        self.y: F = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: B = None
        self.w: G = None
        self.r: B = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: H = None
        self.q: H = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: B = None
        self.y: A = None
        self.o: B = None
        self.x: F = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: A = None
        self.w: G = None
        self.r: A = None
        self.u: B = None
        self.s: G = None
        self.y: F = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: B = None
        self.w: G = None
        self.r: B = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: H = None
        self.q: H = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: B = None
        self.y: A = None
        self.o: B = None
        self.x: F = None
        self.r: F = None
        self.txt = txt

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

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