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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.s: B = None
        self.r: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: B = None
        self.s: D = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: A = None
        self.q: E = None
        self.v: B = None
        self.r: A = None
        self.t: H = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.t: D = None
        self.u: B = None
        self.q: C = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.s: B = None
        self.r: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: B = None
        self.s: D = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: A = None
        self.q: E = None
        self.v: B = None
        self.r: A = None
        self.t: H = None
        self.z: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.t: D = None
        self.u: B = None
        self.q: C = None
        self.y: G = None
        self.txt = txt

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

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