class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: F = None
        self.x: H = None
        self.q: B = None
        self.t: A = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: D = None
        self.o: F = None
        self.q: E = None
        self.v: D = None
        self.y: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: H = None
        self.v: E = None
        self.o: E = None
        self.w: A = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.x: C = None
        self.y: H = None
        self.u: H = None
        self.q: C = None
        self.txt = txt

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

a = A("a")
m = B("m")
h = C("h")
f = D("f")
i = E("i")
c = F("c")
k = G("k")
d = H("d")
l = A("l")

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: D = None
        self.o: F = None
        self.q: E = None
        self.v: D = None
        self.y: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: H = None
        self.v: E = None
        self.o: E = None
        self.w: A = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.x: C = None
        self.y: H = None
        self.u: H = None
        self.q: C = None
        self.txt = txt

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

a = A("a")
m = B("m")
h = C("h")
f = D("f")
i = E("i")
c = F("c")
k = G("k")
d = H("d")
l = A("l")

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