class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: E = None
        self.p: B = None
        self.t: G = None
        self.u: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: H = None
        self.w: E = None
        self.v: A = None
        self.t: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: H = None
        self.w: E = None
        self.v: A = None
        self.t: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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