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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.u: E = None
        self.o: G = None
        self.t: F = None
        self.x: F = None
        self.z: G = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.x: B = None
        self.t: C = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: C = None
        self.p: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: H = None
        self.v: C = None
        self.r: B = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: G = None
        self.z: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: D = None
        self.u: E = None
        self.o: G = None
        self.t: F = None
        self.x: F = None
        self.z: G = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.x: B = None
        self.t: C = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: C = None
        self.p: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: H = None
        self.v: C = None
        self.r: B = None
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: G = None
        self.z: G = None
        self.txt = txt

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

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