class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: H = None
        self.z: D = None
        self.u: C = None
        self.s: H = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.y: E = None
        self.u: E = None
        self.v: H = None
        self.q: E = None
        self.o: H = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: G = None
        self.y: A = None
        self.u: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.q: C = None
        self.t: H = None
        self.x: D = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: A = None
        self.y: E = None
        self.u: E = None
        self.v: H = None
        self.q: E = None
        self.o: H = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: G = None
        self.y: A = None
        self.u: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.q: C = None
        self.t: H = None
        self.x: D = None
        self.y: A = None
        self.o: B = None
        self.txt = txt

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

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

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