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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: C = None
        self.v: G = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: C = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: C = None
        self.v: G = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: C = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

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