class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: C = None
        self.o: B = None
        self.y: H = None
        self.q: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.x: C = None
        self.o: A = None
        self.p: A = None
        self.y: F = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: G = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.w: C = None
        self.z: D = None
        self.u: A = None
        self.s: E = None
        self.t: D = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: A = None
        self.x: C = None
        self.o: A = None
        self.p: A = None
        self.y: F = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: G = None
        self.z: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.w: C = None
        self.z: D = None
        self.u: A = None
        self.s: E = None
        self.t: D = None
        self.y: A = None
        self.txt = txt

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

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