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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: H = None
        self.p: D = None
        self.v: C = None
        self.txt = txt

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

n.r = a
n.v = f
f.q = n
f.p = n
f.s = k
a.p = n
a.y = n
a.u = b
a.q = d
a.s = f
a.o = i
a.t = j
i.x = a
i.z = j
j.t = m
j.y = n
m.r = f
b.s = j
b.p = n
b.u = n
b.x = a
b.q = m
k.o = j
k.r = c
k.p = i
k.v = a
c.o = j
c.r = k
c.p = i
c.v = a
d.s = j
d.p = n
d.u = n
d.x = a
d.q = m
assert c.r.o.t.r.s.r.v.s.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: H = None
        self.p: D = None
        self.v: C = None
        self.txt = txt

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

n.r = a
n.v = f
f.q = n
f.p = n
f.s = k
a.p = n
a.y = n
a.u = b
a.q = d
a.s = f
a.o = i
a.t = j
i.x = a
i.z = j
j.t = m
j.y = n
m.r = f
b.s = j
b.p = n
b.u = n
b.x = a
b.q = m
k.o = j
k.r = c
k.p = i
k.v = a
c.o = j
c.r = k
c.p = i
c.v = a
d.s = j
d.p = n
d.u = n
d.x = a
d.q = m
assert c.r.o.t.r.s.r.v.s.q.v.txt == "f"