class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: F = None
        self.o: D = None
        self.p: D = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.q: D = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.v: E = None
        self.x: C = None
        self.w: E = None
        self.p: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: A = None
        self.q: D = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: E = None
        self.v: E = None
        self.x: C = None
        self.w: E = None
        self.p: F = None
        self.txt = txt

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

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

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