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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.o: H = None
        self.v: H = None
        self.q: C = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: H = None
        self.x: H = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: A = None
        self.o: H = None
        self.v: H = None
        self.q: C = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: H = None
        self.x: H = None
        self.y: A = None
        self.txt = txt

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

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

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

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