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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: H = None
        self.p: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: B = None
        self.q: E = None
        self.v: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.t: E = None
        self.r: H = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: H = None
        self.p: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: B = None
        self.q: E = None
        self.v: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: D = None
        self.t: E = None
        self.r: H = None
        self.p: B = None
        self.u: B = None
        self.txt = txt

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

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