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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: H = None
        self.s: D = None
        self.r: A = None
        self.u: F = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.v: A = None
        self.p: A = None
        self.u: G = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: D = None
        self.u: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: H = None
        self.s: D = None
        self.r: A = None
        self.u: F = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: H = None
        self.v: A = None
        self.p: A = None
        self.u: G = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: D = None
        self.u: C = None
        self.s: A = None
        self.txt = txt

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

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

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

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