class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: D = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: C = None
        self.s: G = None
        self.z: H = None
        self.w: G = None
        self.o: G = None
        self.r: E = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: D = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: G = None
        self.q: C = None
        self.z: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: C = None
        self.s: G = None
        self.z: H = None
        self.w: G = None
        self.o: G = None
        self.r: E = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: D = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: G = None
        self.q: C = None
        self.z: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

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

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

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