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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: E = None
        self.t: B = None
        self.s: G = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.r: G = None
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: D = None
        self.s: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: E = None
        self.t: B = None
        self.s: G = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: H = None
        self.r: G = None
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: D = None
        self.s: B = None
        self.x: D = None
        self.txt = txt

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

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