class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: G = None
        self.r: B = None
        self.q: E = None
        self.u: H = None
        self.p: E = None
        self.z: B = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.y: F = None
        self.p: B = None
        self.o: I = None
        self.x: B = None
        self.s: I = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: A = None
        self.s: H = None
        self.p: D = None
        self.x: C = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.y: F = None
        self.p: B = None
        self.o: I = None
        self.x: B = None
        self.s: I = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: A = None
        self.s: H = None
        self.p: D = None
        self.x: C = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

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