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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: A = None
        self.x: G = None
        self.r: C = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: E = None
        self.u: B = None
        self.y: E = None
        self.z: D = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: E = None
        self.p: B = None
        self.u: E = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.u: G = None
        self.s: B = None
        self.v: D = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: A = None
        self.x: G = None
        self.r: C = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: E = None
        self.u: B = None
        self.y: E = None
        self.z: D = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: E = None
        self.p: B = None
        self.u: E = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.u: G = None
        self.s: B = None
        self.v: D = None
        self.z: C = None
        self.txt = txt

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

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