class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: E = None
        self.q: E = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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