class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: G = None
        self.t: G = None
        self.o: B = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: E = None
        self.x: B = None
        self.q: B = None
        self.w: A = None
        self.txt = txt

h = A("h")
g = B("g")
b = C("b")
j = D("j")
l = E("l")
c = F("c")
d = G("d")
i = H("i")
f = F("f")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: E = None
        self.x: B = None
        self.q: B = None
        self.w: A = None
        self.txt = txt

h = A("h")
g = B("g")
b = C("b")
j = D("j")
l = E("l")
c = F("c")
d = G("d")
i = H("i")
f = F("f")

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