class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.y: E = None
        self.z: F = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: E = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.v: E = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

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

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

a = A("a")
g = B("g")
m = C("m")
l = D("l")
k = E("k")
n = F("n")
f = D("f")
c = D("c")
i = F("i")
h = E("h")

a.w = g
a.u = m
a.y = k
a.z = i
a.x = f
a.s = f
g.q = i
g.p = h
g.o = l
g.z = n
m.x = c
m.z = g
m.t = f
l.u = k
l.z = g
l.v = h
l.x = f
l.r = i
k.s = h
n.u = f
f.u = k
f.v = k
f.z = g
f.x = l
f.r = i
c.u = k
c.v = k
c.z = g
c.x = f
c.r = n
i.u = f
h.s = k
assert h.s.s.s.s.s.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.y: E = None
        self.z: F = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: E = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: B = None
        self.v: E = None
        self.x: D = None
        self.r: F = None
        self.txt = txt

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

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

a = A("a")
g = B("g")
m = C("m")
l = D("l")
k = E("k")
n = F("n")
f = D("f")
c = D("c")
i = F("i")
h = E("h")

a.w = g
a.u = m
a.y = k
a.z = i
a.x = f
a.s = f
g.q = i
g.p = h
g.o = l
g.z = n
m.x = c
m.z = g
m.t = f
l.u = k
l.z = g
l.v = h
l.x = f
l.r = i
k.s = h
n.u = f
f.u = k
f.v = k
f.z = g
f.x = l
f.r = i
c.u = k
c.v = k
c.z = g
c.x = f
c.r = n
i.u = f
h.s = k
assert h.s.s.s.s.s.s.s.s.s.s.txt == "h"