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

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: H = None
        self.v: E = None
        self.p: H = None
        self.t: C = None
        self.o: A = None
        self.x: F = None
        self.r: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: E = None
        self.s: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: H = None
        self.v: E = None
        self.p: H = None
        self.t: C = None
        self.o: A = None
        self.x: F = None
        self.r: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: E = None
        self.s: D = None
        self.txt = txt

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

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