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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: I = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: A = None
        self.u: I = None
        self.z: D = None
        self.t: B = None
        self.o: C = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: A = None
        self.z: E = None
        self.u: B = None
        self.o: E = None
        self.q: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: D = None
        self.o: F = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.r: B = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: I = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: A = None
        self.u: I = None
        self.z: D = None
        self.t: B = None
        self.o: C = None
        self.q: E = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: A = None
        self.z: E = None
        self.u: B = None
        self.o: E = None
        self.q: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: D = None
        self.o: F = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: A = None
        self.r: B = None
        self.x: F = None
        self.txt = txt

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

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