class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: F = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.t: F = None
        self.z: C = None
        self.v: A = None
        self.w: H = None
        self.u: F = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.w: F = None
        self.s: C = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: C = None
        self.t: F = None
        self.z: C = None
        self.v: A = None
        self.w: H = None
        self.u: F = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: D = None
        self.w: F = None
        self.s: C = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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