class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.o: F = None
        self.s: H = None
        self.p: E = None
        self.r: E = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: G = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: H = None
        self.s: C = None
        self.z: B = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
k = C("k")
h = D("h")
a = E("a")
n = F("n")
c = G("c")
g = H("g")

b.y = n
b.x = n
l.s = b
k.r = l
k.v = h
k.o = h
k.x = n
k.s = g
h.t = l
h.v = l
h.o = n
h.s = g
h.x = g
h.p = a
h.r = a
a.x = h
a.v = h
a.w = c
n.v = g
n.t = g
n.s = k
n.z = l
c.p = k
c.o = a
c.r = b
c.t = l
g.o = b
g.z = h
g.v = k
g.s = k
g.r = a
g.w = l
assert b.y.z.s.x.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.o: F = None
        self.s: H = None
        self.p: E = None
        self.r: E = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: G = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: H = None
        self.s: C = None
        self.z: B = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
k = C("k")
h = D("h")
a = E("a")
n = F("n")
c = G("c")
g = H("g")

b.y = n
b.x = n
l.s = b
k.r = l
k.v = h
k.o = h
k.x = n
k.s = g
h.t = l
h.v = l
h.o = n
h.s = g
h.x = g
h.p = a
h.r = a
a.x = h
a.v = h
a.w = c
n.v = g
n.t = g
n.s = k
n.z = l
c.p = k
c.o = a
c.r = b
c.t = l
g.o = b
g.z = h
g.v = k
g.s = k
g.r = a
g.w = l
assert b.y.z.s.x.s.s.txt == "g"