class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: C = None
        self.x: H = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: H = None
        self.t: C = None
        self.u: E = None
        self.o: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
m = C("m")
g = D("g")
d = E("d")
h = F("h")
b = G("b")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: H = None
        self.t: C = None
        self.u: E = None
        self.o: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.txt = txt

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

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

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

j = A("j")
e = B("e")
m = C("m")
g = D("g")
d = E("d")
h = F("h")
b = G("b")
k = H("k")

j.t = h
j.w = m
j.x = k
j.y = k
e.r = m
e.t = m
e.z = k
e.u = d
e.o = b
e.w = g
m.o = j
m.q = d
m.t = e
g.t = k
g.q = e
g.r = d
d.u = h
d.z = b
h.w = d
h.y = g
h.s = j
h.o = m
b.y = j
b.v = h
b.t = h
k.r = h
k.v = e
k.q = d
assert h.w.u.o.txt == "m"