class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.o: C = None
        self.v: E = None
        self.w: D = None
        self.y: E = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.u: A = None
        self.o: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.w: G = None
        self.v: C = None
        self.z: C = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

e = A("e")
g = B("g")
m = C("m")
f = D("f")
l = E("l")
k = F("k")
b = G("b")
h = H("h")
a = F("a")

e.q = a
e.t = l
g.r = e
g.t = e
g.x = l
g.v = l
g.y = l
g.o = m
g.w = f
m.r = k
m.v = g
m.p = h
m.q = f
m.y = f
f.v = m
l.x = m
l.o = m
l.r = g
l.p = g
l.u = e
k.s = l
k.t = m
k.v = m
k.z = m
k.w = b
k.q = a
k.p = g
b.o = f
b.u = h
b.w = k
b.t = m
h.z = l
h.y = l
h.q = e
h.u = b
h.r = g
h.v = m
h.s = m
h.w = f
a.s = l
a.t = m
a.v = m
a.z = m
a.w = b
a.q = k
a.p = g
assert g.o.r.s.u.t.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: E = None
        self.o: C = None
        self.v: E = None
        self.w: D = None
        self.y: E = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.u: A = None
        self.o: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: C = None
        self.w: G = None
        self.v: C = None
        self.z: C = None
        self.q: F = None
        self.p: B = None
        self.txt = txt

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

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

e = A("e")
g = B("g")
m = C("m")
f = D("f")
l = E("l")
k = F("k")
b = G("b")
h = H("h")
a = F("a")

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