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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: H = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: C = None
        self.z: H = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: H = None
        self.x: F = None
        self.t: H = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: H = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: C = None
        self.z: H = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: H = None
        self.x: F = None
        self.t: H = None
        self.w: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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