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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

j.y = m
j.x = f
i.p = n
h.p = e
h.z = j
h.y = j
h.v = n
m.y = g
e.q = h
e.w = h
e.r = i
e.s = n
e.x = f
f.y = e
f.w = i
f.r = m
g.w = j
g.v = n
n.y = j
n.v = j
n.q = j
assert i.p.y.x.r.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

j.y = m
j.x = f
i.p = n
h.p = e
h.z = j
h.y = j
h.v = n
m.y = g
e.q = h
e.w = h
e.r = i
e.s = n
e.x = f
f.y = e
f.w = i
f.r = m
g.w = j
g.v = n
n.y = j
n.v = j
n.q = j
assert i.p.y.x.r.y.w.txt == "j"