class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: B = None
        self.z: H = None
        self.x: H = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: D = None
        self.z: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: E = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: B = None
        self.z: H = None
        self.x: H = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: D = None
        self.z: B = None
        self.x: A = None
        self.txt = txt

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

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