class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.s: F = None
        self.u: H = None
        self.p: B = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: F = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: G = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: F = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: G = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

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

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

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

j.q = n
j.p = n
j.y = i
j.o = i
j.s = m
j.w = m
j.u = l
n.o = i
n.y = m
n.r = f
f.p = e
e.v = m
i.y = e
i.u = f
i.v = f
m.v = b
m.q = g
m.y = j
m.o = n
g.o = j
l.q = j
l.o = f
l.z = e
h.q = n
h.p = n
h.y = i
h.o = i
h.s = m
h.w = m
h.u = b
b.q = j
b.o = f
b.z = e
assert g.o.s.y.q.r.p.v.q.txt == "g"