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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: E = None
        self.y: G = None
        self.r: G = None
        self.x: A = None
        self.z: H = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

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

n = A("n")
c = B("c")
g = C("g")
i = D("i")
j = E("j")
d = F("d")
b = G("b")
k = H("k")
e = H("e")

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: E = None
        self.y: G = None
        self.r: G = None
        self.x: A = None
        self.z: H = None
        self.s: E = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.q: E = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: B = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

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

n = A("n")
c = B("c")
g = C("g")
i = D("i")
j = E("j")
d = F("d")
b = G("b")
k = H("k")
e = H("e")

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