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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.y: F = None
        self.x: E = None
        self.p: H = None
        self.w: E = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.q: A = None
        self.r: G = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.y: F = None
        self.x: E = None
        self.p: H = None
        self.w: E = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.q: A = None
        self.r: G = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: I = None
        self.txt = txt

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

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