class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: G = None
        self.t: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: C = None
        self.o: A = None
        self.x: D = None
        self.w: A = None
        self.z: D = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.v: E = None
        self.x: B = None
        self.t: H = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: C = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

c = A("c")
j = B("j")
m = C("m")
f = D("f")
a = E("a")
l = F("l")
d = G("d")
n = H("n")

c.o = f
c.r = d
c.x = d
c.t = m
j.q = n
j.t = m
j.o = c
j.w = c
j.x = f
j.z = f
j.p = d
m.q = j
m.x = j
m.y = l
m.v = a
m.t = n
m.w = n
f.x = j
a.t = n
a.q = m
a.r = d
a.y = c
l.w = c
d.r = n
d.p = n
d.t = j
d.s = m
d.v = f
d.x = f
n.q = m
n.z = m
n.w = m
n.s = c
n.x = a
n.t = a
n.v = d
n.y = l
assert f.x.t.y.w.r.p.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: G = None
        self.t: C = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: C = None
        self.o: A = None
        self.x: D = None
        self.w: A = None
        self.z: D = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.v: E = None
        self.x: B = None
        self.t: H = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: C = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

c = A("c")
j = B("j")
m = C("m")
f = D("f")
a = E("a")
l = F("l")
d = G("d")
n = H("n")

c.o = f
c.r = d
c.x = d
c.t = m
j.q = n
j.t = m
j.o = c
j.w = c
j.x = f
j.z = f
j.p = d
m.q = j
m.x = j
m.y = l
m.v = a
m.t = n
m.w = n
f.x = j
a.t = n
a.q = m
a.r = d
a.y = c
l.w = c
d.r = n
d.p = n
d.t = j
d.s = m
d.v = f
d.x = f
n.q = m
n.z = m
n.w = m
n.s = c
n.x = a
n.t = a
n.v = d
n.y = l
assert f.x.t.y.w.r.p.s.r.txt == "d"