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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.z: F = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: G = None
        self.w: A = None
        self.q: F = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: F = None
        self.s: H = None
        self.w: H = None
        self.o: C = None
        self.x: A = None
        self.p: A = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: D = None
        self.txt = txt

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

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

k = A("k")
n = B("n")
d = C("d")
g = D("g")
c = E("c")
f = F("f")
m = G("m")
e = H("e")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.z: F = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: G = None
        self.w: A = None
        self.q: F = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: F = None
        self.s: H = None
        self.w: H = None
        self.o: C = None
        self.x: A = None
        self.p: A = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: D = None
        self.txt = txt

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

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

k = A("k")
n = B("n")
d = C("d")
g = D("g")
c = E("c")
f = F("f")
m = G("m")
e = H("e")

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