class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: F = None
        self.v: D = None
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: C = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: D = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: E = None
        self.v: B = None
        self.r: E = None
        self.o: C = None
        self.t: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: C = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: D = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: E = None
        self.v: B = None
        self.r: E = None
        self.o: C = None
        self.t: G = None
        self.txt = txt

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

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