class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.s: D = None
        self.y: H = None
        self.r: F = None
        self.z: F = None
        self.q: B = None
        self.p: E = None
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: B = None
        self.w: A = None
        self.s: G = None
        self.y: B = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.w: E = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.u: C = None
        self.v: E = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: B = None
        self.q: G = None
        self.s: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: B = None
        self.w: A = None
        self.s: G = None
        self.y: B = None
        self.u: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.w: E = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: E = None
        self.u: C = None
        self.v: E = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: B = None
        self.q: G = None
        self.s: B = None
        self.txt = txt

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

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