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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.w: F = None
        self.v: D = None
        self.o: D = None
        self.txt = txt

h = A("h")
e = B("e")
m = C("m")
k = D("k")
a = E("a")
c = F("c")
d = G("d")
g = H("g")
n = I("n")
b = C("b")

h.v = c
h.w = k
e.v = b
m.p = c
m.w = c
m.q = h
m.s = h
m.o = h
m.y = b
k.u = e
k.s = c
k.w = b
k.t = a
k.p = g
a.q = k
a.v = k
a.o = k
a.z = e
c.y = e
c.q = d
d.t = b
d.q = k
d.w = c
g.x = d
n.t = k
n.u = k
n.v = k
n.o = k
n.w = c
b.p = c
b.w = c
b.q = h
b.s = h
b.o = h
b.y = m
assert h.w.u.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.w: F = None
        self.v: D = None
        self.o: D = None
        self.txt = txt

h = A("h")
e = B("e")
m = C("m")
k = D("k")
a = E("a")
c = F("c")
d = G("d")
g = H("g")
n = I("n")
b = C("b")

h.v = c
h.w = k
e.v = b
m.p = c
m.w = c
m.q = h
m.s = h
m.o = h
m.y = b
k.u = e
k.s = c
k.w = b
k.t = a
k.p = g
a.q = k
a.v = k
a.o = k
a.z = e
c.y = e
c.q = d
d.t = b
d.q = k
d.w = c
g.x = d
n.t = k
n.u = k
n.v = k
n.o = k
n.w = c
b.p = c
b.w = c
b.q = h
b.s = h
b.o = h
b.y = m
assert h.w.u.v.q.txt == "h"