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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.u: G = None
        self.q: A = None
        self.p: C = None
        self.w: G = None
        self.txt = txt

c = A("c")
m = B("m")
f = C("f")
g = D("g")
i = E("i")
b = F("b")
a = G("a")
e = H("e")
j = B("j")

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: D = None
        self.u: G = None
        self.q: A = None
        self.p: C = None
        self.w: G = None
        self.txt = txt

c = A("c")
m = B("m")
f = C("f")
g = D("g")
i = E("i")
b = F("b")
a = G("a")
e = H("e")
j = B("j")

c.s = f
c.w = b
m.p = e
m.r = a
f.p = e
f.w = i
f.v = j
f.r = g
g.o = e
g.u = m
g.x = m
g.z = c
i.y = f
i.v = f
i.o = b
i.p = e
b.t = i
a.p = i
e.y = c
e.q = c
e.x = g
e.u = a
e.w = a
e.p = f
j.p = e
j.r = a
assert m.p.q.s.v.p.p.txt == "f"